package com.gjy.liteflow.flow;

import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-07-29 10:12:07
 */
@Component(value = "a")
@Slf4j
public class Acmp extends NodeComponent {

    @Override
    public void process() throws Exception {
        log.info("process a");
        System.out.println("this.getLoopIndex() = " + this.getLoopIndex());
        TimeUnit.SECONDS.sleep(3);
    }

    @Override
    public void onSuccess() throws Exception {
    }

    @Override
    public void onError(Exception e) throws Exception {
    }


    /*@Override
    public void beforeProcess() {
        log.info("a before");
    }

    @Override
    public void afterProcess() {
        log.info("a after");
    }*/

    /* @Override
    public boolean isAccess() {
        String s = this.getRequestData();
        return Lists.newArrayList("1000111001", "1000111002").contains(s);
    }

    @Override
    public boolean isContinueOnError() {
        return false;
    }

    @Override
    public boolean isEnd() {
        return !isAccess();
    }*/
}
